package com.shop.service;

import com.shop.entity.BulkGoodsDetail;
import com.shop.entity.BulkMerchant;
import com.shop.mapper.BulkGoodsDetailMapper;
import com.shop.model.vo.Rsp;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 批发明细表
 * 对应当时批发时的商品各个属性
 * gaodo(BulkGoodsDetail)表服务接口
 *
 * @author makejava
 * @since 2020-11-26 20:07:24
 */
@Service
@AllArgsConstructor
public class BulkGoodsDetailService {
    private final BulkGoodsDetailMapper bulkGoodsDetailMapper;

    /**
     * 根据订单获得订单项
     *
     * @param bulkMerchant
     * @return
     */
    public Rsp getDetailList(BulkMerchant bulkMerchant) {
        //获取订单id
        Integer id = bulkMerchant.getId();
        //根据id查详情
        List<BulkGoodsDetail> detailList = bulkGoodsDetailMapper.getDetailList(id);
        return Rsp.success(detailList);
    }
}
